package com.xiaobai.customer.config;

import com.alibaba.fastjson.JSON;
import com.xiaobai.customer.exception.BusinessFeignException;
import com.xiaobai.customer.exception.ExceptionInfo;
import com.xiaobai.customer.exception.TipException;
import com.xiaobai.customer.response.ResponseResult;
import feign.Response;
import feign.RetryableException;
import feign.Util;
import feign.codec.ErrorDecoder;
import lombok.extern.slf4j.Slf4j;

import java.nio.charset.Charset;

@Slf4j
public class FeignErrorDecoder implements ErrorDecoder {
    @Override
    public Exception decode(String methodKey, Response response) {
        return new BusinessFeignException(
                response.status(),
                response.status(),
                response.reason());
    }
}
